package com.cc.comm;

/**
 * @author 33314
 * @version 1.0
 * @description: TODO
 * @date 2025/9/2 15:32
 */

import lombok.Data;

import java.util.List;
@Data
public class Page<T> {
    //当前页码
    private Integer pageNum;
    //每页显示数据
    private Integer pageSize;
    //总记录数
    private Integer totalCount;
    //总页数
    private Integer totalPage;
    //数据
    private List<T> data;
    public void setTotalCount(Integer totalCount) {
        if (totalCount > 0) {
            this.totalCount = totalCount;
            this.totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
        }
    }
}
